function fn_loadSocialCombo(){
	var arr = [];
	for (var i = 0; i < existEmpStore.getCount(); i++) {
		arr.push(existEmpStore.getAt(i).data.employee_id);
	}
	Ext.getCmp("SHOW_NAME2").reset();
	socialTypeMasterStore.proxy = new Ext.data.HttpProxy({
		url:"socialItem!findSocialItemByEmps.action"
	});
	socialTypeMasterStore.on('beforeload', function() {
		socialTypeMasterStore.baseParams = {
			"masFilter.ids" : arr.join(",")
		}
	});
	socialTypeMasterStore.load();
}
//所有删除的员工项
	var deletedJson = [];
	var reader_temp = new Ext.data.JsonReader({
			root : 'payClassEmpList',
			id: 'existEmpStore_1'
		},[{
			name : 'employee_id',
			mapping : 'employee_id'
		}, {
			name : 'emp_cs_code',
			mapping : 'emp_cs_code'
		}, {
			name : 'name',
			mapping : 'name'
		}, {
			name : 'id_card_num',
			mapping : 'id_card_num'
		}]);

	//员工列表gridPanel-----------------------------------------------------------------------------
	var existEmpStore = new Ext.data.Store({
		reader : new Ext.data.JsonReader({
			root : 'recomSocialList',
			id: 'existEmpStore'
		},[{
			name : 'employee_id',
			mapping : 'employee_id'
		}, {
			name : 'emp_cs_code',
			mapping : 'emp_cs_code'
		}, {
			name : 'name',
			mapping : 'name'
		}, {
			name : 'id_card_num',
			mapping : 'id_card_num'
		}])
	});

	var empGridsm = new Ext.grid.CheckboxSelectionModel();
	var empGridcm = new Ext.grid.ColumnModel([new Ext.grid.RowNumberer(), empGridsm, {
			header : '',
			hidden:true,
			dataIndex : 'employee_id'
		}, {
			header : '员工编号',
			dataIndex : 'emp_cs_code'
		}, {
			header : '姓名',
			dataIndex : 'name'
		}, {
			header : '证件号',
			dataIndex : 'id_card_num',
			width : 150
		}]);
		
	//调用的时候直接把empGridPanel 加入窗口item就可以了
	var empGridPanel;
	function fn_empGridPanel(){	
		empGridPanel = new Ext.grid.GridPanel({
			height : 300,
			anchor : '90%',
			region: 'center',
			autoDestroy : "false",
			id : 'empGridPanel',
			tbar:[{
					xtype : 'button',
					text : '添加员工',
					id : '_btnAdd',
					handler : function() {
						selectEmpWin.show();
					}
				},{
					xtype : 'button',
					text : '删除员工',
					id : '_btnDel',
					handler : function() {
						empGridPanel.stopEditing();
				   		var length = empGridPanel.getSelectionModel().getSelections().length;
					   	if (length < 1) {
							return;
						}
					   	Ext.MessageBox.show({
							title : '提示',
							msg : '您选中了' + length + '条记录进行删除,请问您确认吗?',
							buttons : Ext.MessageBox.OKCANCEL,
							fn : function(btn) {
								if (btn == "ok") {
									var delRecords = empGridPanel.getSelectionModel().getSelections();
									for (var i = 0; i < length; i++){
										var index = existEmpStore.find('employee_id', delRecords[i].data.employee_id);
										deletedJson.push(delRecords[i].data);
										
										existEmpStore.remove(existEmpStore.getAt(index));
									}
									fn_loadSocialCombo();
								}
								if (btn == "cancel") {
									return;
								}
							}
						}); 
					}
				}],
			sm : empGridsm,
			cm : empGridcm,
			store : existEmpStore,
			loadMask : true,
			loadMask : {
				msg : '正在加载数据...'
			}
		});
		return empGridPanel;
	}

	var selectEmpGridsm = new Ext.grid.CheckboxSelectionModel();
	var selectEmpGridcm = new Ext.grid.ColumnModel([new Ext.grid.RowNumberer(), selectEmpGridsm, {
			header : '',
			hidden:true,
			dataIndex : 'employee_id'
		}, {
			header : '员工编号',
			dataIndex : 'emp_cs_code'
		}, {
			header : '姓名',
			dataIndex : 'name'
		}, {
			header : '证件号',
			dataIndex : 'id_card_num',
			width : 150
		}]);
	
	
	//选取员工gridPanel--------------------------------------------------------------------------------------	
	var selectEmpStore = new Ext.data.Store({
			url : 'employeeAction!queryCsEmployeeResult.action',
			reader : new Ext.data.JsonReader({
				root : 'pbEmployeeResult.result',
				totalProperty : 'pbEmployeeResult.totalCount'
			}, [{
				name : 'employee_id',
				mapping : 'employee_id'
			}, {
				name : 'emp_cs_code',
				mapping : 'emp_cs_code'
			}, {
				name : 'name',
				mapping : 'name'
			}, {
				name : 'id_card_num',
				mapping : 'id_card_num'
			}])
		});
//	selectEmpStore.load();
	
	var selectEmpGrid = new Ext.grid.GridPanel({
		autoScroll:true,
		id : 'selectEmpGrid',
		region: 'center',
		tbar:['员工编号:', {
				xtype:'textfield',
				id:'empCsCode',
				name:'empCsCode'
			},{xtype:"tbseparator"},
			'员工姓名:',{
				xtype:'textfield',
				id:'name',
				name:'name'
			},{xtype:"tbseparator"},
			{
				xtype : 'button',
				text : '查询',
				handler : function() {
					selectEmpStore.on('beforeload', function() {
						selectEmpStore.baseParams = {
							'pbEmployeeFilter.empCsCode' : Ext.getCmp('empCsCode').getValue(),
							'pbEmployeeFilter.name' : Ext.getCmp('name').getValue(),
							'pbEmployeeFilter.startIndex' : 20,
							'pbEmployeeFilter.endIndex' : 0
						}
					});
					selectEmpStore.reload();
				}
			}],
		sm : selectEmpGridsm,
		cm : selectEmpGridcm,
		store : selectEmpStore,
		loadMask : true,
		loadMask : {
			msg : '正在加载数据...'
		},
		frame : true,
		clicksToEdit : 1,
		bbar:new Ext.PagingToolbar({
			pageSize:pageSize,
			store:selectEmpStore,
			displayInfo:true,
			dispalyMsg:'显示第{0}条到{1}条记录，一共{2}条',
			emptyMsg:'没有记录'
			})
	});
	
	//选择员工主窗口-------------------------------------------------------------------------------------------
	var selectEmpWin = new Ext.Window({
		layout:'border',
		closable : true,
		draggable : true,
		id:'selectEmpWin',
		title : '员工查询',
		width : 450,
		height : 350,
		closeAction : 'hide',
		plain : true,
		items : [selectEmpGrid],
		buttons : [{
					text : '选择',
					id : 'btnSelect',
					handler : function() {
						var selectRecords = selectEmpGrid.getSelectionModel().getSelections();
						var selectLength = selectEmpGrid.getSelectionModel().getSelections().length;
						
						for(var j = 0; j < selectLength; j++){
							var index = existEmpStore.find('employee_id', selectRecords[j].data.employee_id);
							if(index == -1){
								existEmpStore.add(selectRecords[j]);
							}
						};
						Ext.MessageBox.show({
							title : '操作信息',
							msg : '已成功选择，是否继续添加？',
							buttons : Ext.MessageBox.OKCANCEL,
							fn : function(btn) {
								if (btn == "ok") {
									return;
								}
								if (btn == "cancel") {
									selectEmpWin.hide();
								}
							}
						});
					}
				}, {
					text : '关闭',
					id : 'btnClose',
					handler : function() {
						selectEmpWin.hide();
					}
				}],
		listeners : {
			"hide" : function(obj) {
				fn_loadSocialCombo();
			}
		}
	});

